<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>新增楼宇</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
	function openNewWindow(field1) {
		var btn =  document.getElementById("btn1");
		var iTop = (window.screen.availHeight - 30 - 600) / 2; 
           //获得窗口的水平位置 
        var iLeft = (window.screen.availWidth - 10 - 800) / 2; 
		var str = window.open(field1,'','width=800,height=600,left='+iLeft+',top='+iTop);
		
		
	}
	
	</script>
	
</head>
<body>
	<form:form id="inputForm" modelAttribute="building" action="${ctx}/admin/building/addAdmin" method="post" class="form-horizontal">
		<sys:message content="${message}"/>
		
		<form:hidden path="id" value="${building.id }"/>
		<div class="control-group">
			<label class="control-label">楼名:</label>
			<div class="controls">
				<form:input path="buildingName" value="${building.buildingName }" htmlEscape="false" maxlength="50" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<table id="contentTable" class="table table-striped table-bordered table-condensed">
			<thead>
				<th>管理员</th>
				<th>管理员手机</th>
				<th>操作</th>
				
			</thead>
			<c:forEach items="${user }" var="a">
				<tr>
					<td>${a.name }</td>
					<td>${a.mobile }</td>
					<td>
					<a  href="${ctx}/admin/building/deleteAdmin?buildingId=${building.id}&adminId=${a.id}" onClick="return confirm('确定删除?');">删除</a></td>
				</tr>
			</c:forEach>
		</table>
		
		<div class="control-group">
			<label class="control-label">新增管理员:</label>
			<div class="controls">
				<input onclick="openNewWindow('${ctx}/admin/building/adminsList')" type="button" value="请选择管理员"/>
				 <div class="controls" id="teacher"  class="required"></div>			 


			</div>

			<form:hidden path="adminsId" id="teacherids" name="teacherids"/>
				
				
			</div>
			
		</div>
		
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>